package Commander;

/**
 * @author Charles Huang <br>
 * Kolonel Steele is best known for leading the 13th armored division
 * up Hill 365, charging against a force over four times the size of his
 * own and succeeding. However, hundreds of tank crews lost their lives
 * on the day before BattleBot tank crews were introduced. Although his
 * armor his now driven by pilots as mechanical as their machines, he now 
 * has a preference for heavy armor that keeps the crews safe. Some consider
 * his preference of heavy armor over mobility obsolete, but the results
 * speak for themselves. Being a skilled mechanic as well, the Kolonel personally
 * removed every engine governor in his tanks, giving them a potentially higher
 * maximum speed despite their increased bulk, though this can only
 * be used in moderation.
 */
public class KolonelSteele extends Commander
{
	public KolonelSteele()
	{
		super("Kolonel Steele", 2000, -1, 0.7, 1.0);
	}
	
	public int getMoveMod(Unit Unit)
	{
		if(Unit instanceof Heavy_Vehicle)
		{
			return super.getMoveMod(Unit); 
		}
		return 0;
	}
	
	/**
	 * @param Target - the defending unit
	 * @param Attacker - the attacking unit
	 * Kolonel Steel's armored vehicles get a general 20% defensive buff
	 * @return defenseMod - returns multiplier for damage received, a number < 1 <br>
	 * is a bonus, > 1 is a penalty, and 1 is no change
	 */
	public double getDefenseMod(Unit Target, Unit Attacker)
	{
		if(super.getPower() && Target instanceof Infantry)
		{
			return super.getDefenseMod(Attacker, Target);
		}
		return 1.0;
	}
	
	/**
	 * Kolonel Steele's power gives a a +2 movement boost to armored vehicles
	 * and increases their defensive boost to 30%
	 */
	public void activatePower()
	{
		super.activatePower();
		setMoveMod(1);
		setDefenseMod(0.7);
	}
	
	public void deactivatePower()
	{
		super.deactivatePower();
		setMoveMod(-1);
		setDefenseMod(0.8);
	}
}
